package ClassHomeworkTest;
/*
第一题：设计日期类，每个日期对象都可以描述年月日信息
 */
public class MyDate {
    private int year;
    private int month;
    private int day;
    public MyDate(){

    }
    public MyDate(int year, int month, int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public int getYear(){
        return this.year;
    }
    public void setYear(int year){
        this.year = year;
    }
    public int getMonth(){
        return this.month;
    }
    public void setMonth(int month){
        this.month = month;
    }
    public int getDay(){
        return this.day;
    }
    public void setDay(int day){
        this.day = day;
    }
    @Override
    public String toString(){
        return this.year+"年"+this.month+"月"+this.day+"日";
    }
}
